package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.CompanyDao;
import com.platform.server.service.CompanyService;

@Service
public class CompanyServiceImpl implements CompanyService {

	@Autowired
	private CompanyDao companyDao;
	
	/**
	 * 查看企业审核列表
	 * @return
	 */
	@Override
	public List<Map<String, Object>> selectCompanyList(String userid,String audit,String company_name,String startTime,String endTime,String mobile,String address,String id) {
		Map<String,Object> map = new HashMap<>();
		map.put("userid", userid);
		map.put("audit", audit);
		map.put("company_name", company_name);
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("mobile", mobile);
		map.put("address", address);
		map.put("id", id);
		return companyDao.selectCompanyList(map);
	}

	
	/**
	 * 修改企业审核状态
	 */
	@Override
	public int updateCompanyStatus(Integer id, String audit,String name) {
		Map<String,Object> map = new HashMap<>();
		map.put("id", id);
		map.put("audit", audit);
		map.put("name", name);
		return companyDao.updateCompanyStatus(map);
	}


	@Override
	public List<Map<String, Object>> selectStatus(Map<String, Object> map) {
		return companyDao.selectStatus(map);
	}


	@Override
	public int updateUserGrade(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return companyDao.updateUserGrade(map);
	}

}
